Only resume xenbus /after/ we've prepared our VCPUs; otherwise the
authorsmh22@firebug.cl.cam.ac.uk <smh22@firebug.cl.cam.ac.uk>
Fri, 18 Nov 2005 18:56:03 +0000 (19:56 +0100)
committersmh22@firebug.cl.cam.ac.uk <smh22@firebug.cl.cam.ac.uk>
Fri, 18 Nov 2005 18:56:03 +0000 (19:56 +0100)
VCPU hotplug callback can race with our vcpu_prepare.

Signed-off-by: Steven Hand <steven@xensource.com>
linux-2.6-xen-sparse/arch/xen/kernel/reboot.c

index b403d1e00472ae712e4f3a794aa4ef065fbabb56..c77cd2eadf37f411e950dbe5832908163ab6fdc5 100644 (file)
@@ -182,12 +182,20 @@ static int __do_suspend(void *ignore)
 
        xencons_resume();
 
-       xenbus_resume();
-
 #ifdef CONFIG_SMP
        for_each_cpu(i)
                vcpu_prepare(i);
 
+#endif
+
+       /* 
+       ** Only resume xenbus /after/ we've prepared our VCPUs; otherwise
+       ** the VCPU hotplug callback can race with our vcpu_prepare
+       */
+       xenbus_resume();
+
+
+#ifdef CONFIG_SMP
  out_reenable_cpus:
        for_each_cpu_mask(i, prev_online_cpus) {
                j = cpu_up(i);